#ifndef WIDGET_H
#define WIDGET_H

#include"Head.h"
#include "try.cpp"
#include "Myrectitem.h"
#include"Mylineitem.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
    QModelIndex findIndexByName(QStandardItemModel *model1, QString &name);
    QModelIndex findIndexByNameRecursive(QStandardItem *parentItem, QString &name);
    void paintrname(MyRectItem* R,string name);


private slots:

    void changeselect(QString msg);

    void on_Init_clicked();

    void on_DisplayselfB_clicked();

    void on_Mofidy_clicked();

    void on_AddbrotherB_clicked();

    void on_AddchildB_clicked();

    void on_DisplaydireB_clicked();

    void on_Change_clicked();

    void on_pushButton_clicked();

    void on_CountGen_clicked();

    void on_Save_clicked();

    void on_Load_clicked();

    void on_Exit_clicked();

    void on_update_clicked();

    void on_treeView_clicked();

    void on_paint_clicked();

private:
    Ui::Widget *ui;
    QString title="欢迎来到家族树维护系统";
    QStandardItemModel *model;
    vector<Node*> rbin;
    QGraphicsScene *scene;
    vector<MyRectItem *>* vvr=NULL;
};
#endif // WIDGET_H
